home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / TSMTE.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  4KB  |  154 lines

  1. /*
  2.      File:        TSMTE.h
  3.  
  4.      Contains:    Text Services Managerfor TextEdit Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __TSMTE__
  19. #define __TSMTE__
  20.  
  21. #ifndef __TEXTEDIT__
  22. #include <TextEdit.h>
  23. #endif
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27. #ifndef __APPLEEVENTS__
  28. #include <AppleEvents.h>
  29. #endif
  30. #ifndef __TEXTSERVICES__
  31. #include <TextServices.h>
  32. #endif
  33. /* #include <Gestalt.i>*/
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT_SUPPORTED
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_ALIGN_SUPPORTED
  44. #pragma options align=mac68k
  45. #endif
  46.  
  47. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  48. /* signature, interface types*/
  49.  
  50. enum {
  51.     kTSMTESignature                = 'tmTE',
  52.     kTSMTEInterfaceType            = 'tmTE',
  53.     kTSMTEDialog                = 'tmDI'
  54. };
  55.  
  56. /* update flag for TSMTERec*/
  57.  
  58. enum {
  59.     kTSMTEAutoScroll            = 1
  60. };
  61.  
  62. /* callback procedure definitions*/
  63. typedef pascal void (*TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
  64. typedef pascal void (*TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  65.  
  66. #if GENERATINGCFM
  67. typedef UniversalProcPtr TSMTEPreUpdateUPP;
  68. typedef UniversalProcPtr TSMTEPostUpdateUPP;
  69. #else
  70. typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
  71. typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
  72. #endif
  73. /* data types*/
  74. struct TSMTERec {
  75.     TEHandle                         textH;
  76.     TSMTEPreUpdateUPP                 preUpdateProc;
  77.     TSMTEPostUpdateUPP                 postUpdateProc;
  78.     long                             updateFlag;
  79.     long                             refCon;
  80. };
  81. typedef struct TSMTERec TSMTERec;
  82.  
  83. typedef TSMTERec *TSMTERecPtr;
  84. typedef TSMTERecPtr *TSMTERecHandle;
  85.  
  86. #if GENERATINGCFM
  87. #else
  88. #endif
  89.  
  90. enum {
  91.     uppTSMTEPreUpdateProcInfo = kPascalStackBased
  92.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  93.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  94.     uppTSMTEPostUpdateProcInfo = kPascalStackBased
  95.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  96.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  97.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  98.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  99.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  100.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  101.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long)))
  102. };
  103.  
  104. #if GENERATINGCFM
  105. #define NewTSMTEPreUpdateProc(userRoutine)        \
  106.         (TSMTEPreUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  107. #define NewTSMTEPostUpdateProc(userRoutine)        \
  108.         (TSMTEPostUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  109. #else
  110. #define NewTSMTEPreUpdateProc(userRoutine)        \
  111.         ((TSMTEPreUpdateUPP) (userRoutine))
  112. #define NewTSMTEPostUpdateProc(userRoutine)        \
  113.         ((TSMTEPostUpdateUPP) (userRoutine))
  114. #endif
  115.  
  116. #if GENERATINGCFM
  117. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  118.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  119. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  120.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  121. #else
  122. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  123.         (*(userRoutine))((textH), (refCon))
  124. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  125.         (*(userRoutine))((textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  126. #endif
  127. #endif
  128. #if !FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
  129. struct TSMDialogRecord {
  130.     DialogRecord                     fDialog;
  131.     TSMDocumentID                     fDocID;
  132.     TSMTERecHandle                     fTSMTERecH;
  133.     long                             fTSMTERsvd[3];                /* reserved*/
  134. };
  135. typedef struct TSMDialogRecord TSMDialogRecord;
  136.  
  137. typedef TSMDialogRecord *TSMDialogPeek;
  138. #endif
  139.  
  140. #if PRAGMA_ALIGN_SUPPORTED
  141. #pragma options align=reset
  142. #endif
  143.  
  144. #if PRAGMA_IMPORT_SUPPORTED
  145. #pragma import off
  146. #endif
  147.  
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151.  
  152. #endif /* __TSMTE__ */
  153.  
  154.